package com.zhy.learning.demo.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @author zhy
 * @version 1.0.0
 * @ClassName HelloProxy.java
 * @Description TODO
 * @createTime 2020年11月11日 15:56:00
 */
public class HelloProxy implements InvocationHandler {

    private Object proxied = null;

    public HelloProxy() {
    }

    public HelloProxy(Object proxied) {
        this.proxied = proxied;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("hello proxy");
        return method.invoke(proxied, args);
    }
}
